<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Service_detail_model extends CI_Model
{

    private $table = 'group6_tbl_service_detail';

    public function get_all_by_service_id($id)
    {
        $this->db->select('group6_tbl_service.service_id, group6_tbl_service.service_name');
        $this->db->select($this->table . '.group6_service_detail_id');
        $this->db->select('firstname, lastname, group6_tbl_user.user_id');
        $this->db->join('group6_tbl_service', 'group6_tbl_service.service_id = '. $this->table . '.service_id');
        $this->db->join('group6_tbl_user', 'group6_tbl_user.user_id = '. $this->table . '.user_id');
        $this->db->where($this->table . '.service_id', $id);
        return $this->db->get($this->table);
    }

    public function get_by_package_id($id)
    {
        $this->db->select('group6_tbl_service.service_id, group6_tbl_service.service_name');
        $this->db->select($this->table . '.service_detail_id');
        $this->db->select('firstname, lastname, group6_tbl_user.user_id');
        $this->db->join('group6_tbl_service', 'group6_tbl_service.service_id = '. $this->table . '.service_id');
        $this->db->join('group6_tbl_user', 'group6_tbl_user.user_id = '. $this->table . '.user_id');
        $this->db->where($this->table . '.service_id', $id);

        return $this->db->get($this->table);
    }

}
